local skel = fk.CreateSkill {
  name = "emo__dayi",
  tags = {Skill.Compulsory, Skill.Lord},
}

Fk:loadTranslationTable{
  ["emo__dayi"] = "大役",
  [":emo__dayi"] = "主公技，锁定技，准备阶段，你令所有其他角色依次交给你一张牌，若交出【杀】改为对你使用之。",

  ["#emo__dayi-give"] = "大役：请交给 %src 一张牌，若为【杀】对其使用之",

  ["$emo__dayi1"] = "朕当亲执武节，行天诛于海外。",
  ["$emo__dayi2"] = "朕篡成宝业，君临天下，岂容蕞尔小丑。",
}

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "control",
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player.phase == Player.Start
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    local tos = room:getOtherPlayers(player)
    for _, to in ipairs(tos) do
      if player.dead then break end
      if not to.dead and not to:isNude() then
        local cid = room:askToCards(to, {
          min_num = 1, max_num = 1, skill_name = skel.name, include_equip = true, cancelable = false,
          prompt = "#emo__dayi-give:" .. player.id
        })[1]
        if Fk:getCardById(cid).trueName == "slash" then
          room:useCard{
            from = to, tos = {player}, card = Fk:getCardById(cid), extraUse = true,
          }
        else
          room:obtainCard(player, cid, true, fk.ReasonGive, to, skel.name)
        end
      end
    end
  end,
})

return skel
